package net.iceflow.dunsel.client.listener;

import net.iceflow.dunsel.client.ClientFacade;
import net.iceflow.dunsel.commons.Event;
import net.iceflow.dunsel.commons.ListenerCallAdapter;

/**
 * The listener interface for receiving failed connection events on the facade.
 */
public interface FailedConnectionListener {

    /**
     * Invoked when a ClientFacade fails to connect to a server instance.
     */
    void onConnectionFailed(Event<ClientFacade> e);

    public class CallAdapter implements ListenerCallAdapter<FailedConnectionListener, ClientFacade> {
        @Override
        public void callListener(Event<ClientFacade> event, FailedConnectionListener listener) {
            listener.onConnectionFailed(event);
        }
    }
}
